package com.generator.controller.course;

import com.generator.entity.course.Course;
import com.generator.service.course.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/generate")
@CrossOrigin(allowCredentials = "true")
public class CourseController {

    @Autowired
    private CourseService courseService;

    @GetMapping("/findAllCourses")
    public List<Course> findAllCourses() {
        return courseService.findAllCourses();
    }
}
